<!-- include tpl=login/header title=用户登录 -->
<script type="text/javascript">
var uni_load = false;
function weixin_ap_login()
{
	if(!uni_load){
		$.dialog.tips('环境未加载守成，请稍候…');
		return false;
	}
	var url = "/pages/wxlogin/index";
	uni.reLaunch({
		"url":url,
		"success":function(){
			console.log('接口调用成功');
		},
		"fail":function(res){
			console.log('接口调用失败'+JSON.stringify(res));
		},
		"complete":function(){
			console.log('执行操作完成');
		}
	});
}
function weixin_mp_login()
{
	console.log('微信公众号用户登录')
}
$(document).ready(function(){
	document.addEventListener('UniAppJSBridgeReady', function() {  
		console.log('成功加载UniAPP');
		uni_load = true;
		uni.getEnv(function(res) {
			console.log('当前环境：' + JSON.stringify(res))
		});
	});
});
</script>
<section class="container pt-4 mb-4">
	<div class="row justify-content-center">
		<div class="col col-sm-6 p-4 m-4 bg-white border shadow">
			<h3 class="text-center">用户登录</h3>
			<hr />
			<form onsubmit="return $.login.ok(this)" method="post" id="login-submit">
				<input type="hidden" name="_back" id="_back" value="{$_back}" />
				<div class="form-group">
					<label for="doc-ipt-email-1">账号</label>
					<input type="text" class="form-control" required id="doc-ipt-email-1" name="user" placeholder="请输入账号/邮箱/手机号" />
				</div>
				<div class="form-group">
					<label for="doc-ipt-pwd-1">密码</label>
					<input type="password" class="form-control" required id="doc-ipt-pwd-1" name="pass" placeholder="请输入密码" />
				</div>
				<!-- if $is_vcode -->
				<div class="form-group">
					<label for="_chkcode">验证码 <img src="{#images#}/blank.gif" border="0" align="absmiddle" id="vcode" class="hand" /></label>
					<input type="text" class="form-control" required name="_chkcode" id="_chkcode" placeholder="请输入图片上的字符" />
				</div>
				<!-- /if -->
				<div class="row">
					<div class="col">
						<button type="submit" class="btn btn-primary">登录</button>
					</div>
					<div class="col text-right">
						<a href="{$sys.url}" class="btn btn-light">网站首页</a>
					</div>
				</div>
				<div class="row mt-4">
					<!-- if $config.register_status -->
					<div class="col col-6 col-xl-3 pt-2">
						<a href="{url ctrl=register/}" class="btn btn-light btn-block"><i class="fa fa-user-plus"></i> 用户注册</a>
					</div>
					<!-- /if -->
					<!-- if $login_sms -->
					<div class="col col-6 col-xl-3 pt-2">
						<a href="{url ctrl=login func=sms/}" class="btn btn-light btn-block"><i class="fa fa-mobile"></i> 短信登录</a>
					</div>
					<!-- /if -->
					<!-- if $login_email -->
					<div class="col col-6 col-xl-3 pt-2">
						<a href="{url ctrl=login func=email/}" class="btn btn-light btn-block"><i class="fa fa-envelope-o"></i> 邮件登录</a>
					</div>
					<!-- /if -->
					<!-- if $login_sms || $login_email -->
					<div class="col col-6 col-xl-3 pt-2">
						<a href="{url ctrl=login func=getpass/}" class="btn btn-light btn-block"><i class="fa fa-location-arrow"></i> 找回密码</a>
					</div>
					<!-- /if -->
				</div>
				<!-- if $platform && $platform == 'weixin' -->
				<!-- if $program == 'ap' -->
				<div class="m-1">
					<button type="button" class="btn btn-primary btn-block" onclick="weixin_ap_login()">微信登录1</button>
				</div>
				<!-- /if -->
				<!-- if $program == 'mp' -->
				<div class="m-1">
					<button type="button" class="btn btn-primary btn-block" onclick="weixin_mp_login()">微信登录2</button>
				</div>
				<!-- /if -->
				<!-- /if -->
			</form>
		</div>
	</div>
</section>
<!-- include tpl=login/footer -->